import { BasicColumn, FormSchema } from "/@/components/Table"
import { useI18n } from '/@/hooks/web/useI18n';
import * as configTmplApi from '/@/api/infra/configTmpl';
const { t } = useI18n('');

export const columns: BasicColumn[] = [
  {
    title: "名称",
    dataIndex: "name",
    width: 130,
    // slots: { customRender: 'name' },
    align: "left",
  },
  {
    title: "类型",
    width: 160,
    dataIndex: "type",
  },
  {
    title: "标识",
    width: 160,
    dataIndex: "configKey",
  },
  {
    title: "备注",
    width: 240,
    dataIndex: "remark",
    align: "left",
  }
]

export const searchFormSchema: FormSchema[] = [
  {
    label: t('名称'),
    field: 'name',
    component: 'Input',
  },
  {
    label: t('标识'),
    field: 'configKey',
    component: 'Input',
  },
  {
    label: t('类型'),
    field: 'type',
    component: 'ApiSelect',
    componentProps: {
      api: configTmplApi.listConfigType,
      showSearch: true,
      allowClear: true,
      labelField: 'label',
      valueField: 'value',
    },
  },
];
